wayland: Survive lack of settings
authorMatthias Clasen <mclasen@redhat.com>
Wed, 18 May 2016 17:08:44 +0000 (13:08 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 19 May 2016 11:38:33 +0000 (07:38 -0400)
This can be made to happen eg by setting XDG_DATA_DIRS and
XDG_DATA_HOME to /. Not a useful value, but not a good reason
to crash either.

gdk/wayland/gdkscreen-wayland.c

index c72c155c6eb88e227d72bb64da8aae0007e97c12..6c8b8b9385017e20c7113a7bbe76eb02a2f94094 100644 (file)
@@ -490,6 +490,8 @@ init_settings (GdkScreen *screen)
   screen_wayland->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
 
   source = g_settings_schema_source_get_default ();
+  if (source == NULL)
+    return;
 
   for (i = 0; i < G_N_ELEMENTS (translations); i++)
     {